import wepy from 'wepy'

export const getTopics = () => wepy.request('/topic/home')

export const getTopic = id => wepy.request(`/topic/${id}`)

export const sendTopic = data => wepy.request({
  method: 'POST',
  url: '/topic',
  data
})

export const sendTopiNew = data => wepy.request({
  method: 'POST',
  url: '/topic/discuss',
  data
})

export const trueTopic = id => wepy.request(`/topic/topicLike/${id}`)

export const getTopicComments = (id, page = 1, size = 10) => wepy.request(`/topic/comment/${id}?page=${page}&size=${size}`)
